// PropPage.h: interface for the CPropPage resizable propertypage class.
//
// Copyright 2002 by SoftGee
//////////////////////////////////////////////////////////////////////////

#if !defined(AFX_PROPPAGE_H__4E36AE31_3F52_11D6_B653_0048548B09C5__INCLUDED_)
#define AFX_PROPPAGE_H__4E36AE31_3F52_11D6_B653_0048548B09C5__INCLUDED_

#pragma once

template <WORD t_wDlgTemplateID, UINT t_nControl0>
class CPropPage : public CPropertyPageImpl<CPropPage>,
					public CDialogResize<CPropPage>
{
public:
	enum { IDD = t_wDlgTemplateID };

	CPropPage()
	{
		// enable title. Title must be set before page
		// is added to property sheet
		m_psp.dwFlags |= PSP_USETITLE;
	}

	// chain both inherited message maps
	BEGIN_MSG_MAP(CPropPage)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		CHAIN_MSG_MAP(CPropertyPageImpl<CPropPage>)
		CHAIN_MSG_MAP(CDialogResize<CPropPage>)
	END_MSG_MAP()

	// add the control to the resize map
	BEGIN_DLGRESIZE_MAP(CPropPage)
		DLGRESIZE_CONTROL(t_nControl0, DLSZ_SIZE_X | DLSZ_SIZE_Y)
	END_DLGRESIZE_MAP()

	LRESULT OnInitDialog(UINT, WPARAM, LPARAM, BOOL&)
	{
		// initialize the resize code. No gripper, no minimum size 
		// tracking, and set window style to child
		DlgResize_Init(false, false, WS_CHILD | WS_CLIPCHILDREN);

		return 0;
	}
};

#endif // !defined(AFX_PROPPAGE_H__4E36AE31_3F52_11D6_B653_0048548B09C5__INCLUDED_)
